
/**
 * Handles data sent via chrome.extension.sendRequest().
 * @param request Object Data sent in the request.
 * @param sender Object Origin of the request.
 * @param callback Function The method to call when the request completes.
 */
// Wire up the listener.
//chrome.extension.onRequest.addListener(onRequest);
chrome.extension.onRequest.addListener(function (request, sender, callback){
		//callback(window.getSelection());
		sel = window.getSelection();
		callback(sel.toString());
		});

/* -- disabled for now
var beginShortcut = 0;
var keyCtrl = 17;
var keyM = 77;
function onKeyEvent(e) {
	if(e.which == keyCtrl) {
		beginShortcut = 1;
	} else if (e.which == keyM) {
		if(beginShortcut == 1) {
		}
		beginShortcut = 0;
	} else {
		beginShortcut = 0;
	}
}

window.addEventListener('keydown', onKeyEvent, false);
*/

